# Maintainer:  Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
# Contributor: Allan McRae <allan@archlinux.org>
# Contributor: judd <jvinet@zeroflux.org>

# NOTE: requires rebuilt with each new gcc version

pkgname=libtool
pkgver=2.4.6+42+gb88cebd5
pkgrel=2
_gccver=8.2.1
pkgdesc='A generic library support script'
arch=(x86_64)
url='http://www.gnu.org/software/libtool'
license=(GPL)
groups=(base-devel)
depends=(sh tar glibc)
makedepends=("gcc>=$_gccver" git help2man)
checkdepends=(gcc-fortran)
provides=("libltdl=$pkgver" "libtool-multilib=$pkgver")
conflicts=(libltdl libtool-multilib)
replaces=(libltdl libtool-multilib)
_commit=b88cebd510add4420dd8f5367e3cc6e6e1f267cd
source=(git+https://git.savannah.gnu.org/git/libtool.git#commit=$_commit)
md5sums=('SKIP')

pkgver() {
  cd libtool
  git describe --tags | sed 's/-/+/g;s/^v//'
}

prepare() {
  cd libtool
  ./bootstrap
}

build() {
  cd libtool
  ./configure --prefix=/usr lt_cv_sys_lib_dlsearch_path_spec="/usr/lib /usr/lib32"
  make
}

check() {
  cd libtool
  make check gl_public_submodule_commit=
}

package() {
  cd libtool
  make DESTDIR="$pkgdir" install
}
